//
//  HMBarView.m
//  HowToDo
//
//  Created by 胡坤 on 2017/1/5.
//  Copyright © 2017年 KY. All rights reserved.
//

#import "HMBarView.h"

@implementation HMBarView

- (void)drawRect:(CGRect)rect {
    // Drawing code
    //绘制白色区域
    UIBezierPath * path = [UIBezierPath bezierPathWithRect:self.bounds];
    
    //设置白色
    [[UIColor whiteColor] set];
    
    [path fill];
    
    //画一根线
    CGFloat h = 1 / [UIScreen mainScreen].scale;
    
    CGFloat y = self.bounds.size.height - h;
    
    CGFloat x = 0;
    
    CGFloat w = self.bounds.size.width;
    
    UIBezierPath * linePath = [UIBezierPath bezierPath];
    
    [linePath moveToPoint:CGPointMake(x, y)];
    
    [linePath addLineToPoint:CGPointMake(w, y)];
    //设置颜色
    [[UIColor grayColor] set];
    
    [linePath stroke];
}

@end
